const Sequelize = require('sequelize');

import sequelize from './db/sequelize';

/**
 * 单张图片实体
 */
const Token = sequelize.define('tokens', {
  id                    : {type: Sequelize.BIGINT,   allowNull: false, primaryKey: true, autoIncrement: true},
  phone_uid             : {type: Sequelize.STRING,   allowNull: true },
  qq_uid                : {type: Sequelize.STRING,   allowNull: true },
  wechat_uid            : {type: Sequelize.STRING,   allowNull: true },
  token                 : {type: Sequelize.STRING,   allowNull: true, unique:'account_token_index'  },
  ctime                 : {type: Sequelize.STRING,   allowNull: true},
  status                : {type: Sequelize.INTEGER,  allowNull: false, defaultValue: 1},
},
{
    charset: 'utf8'
});

Token.sync({force: false}).then(function(){});
export default Token;